/* Copyright (c) 2009 SpringShowcase, Inc.
 * All right reserved.
 * http://code.google.com/p/springshowcase/
 * This software is the confidential and proprietary information of BeyondWeb
 * , Inc. You shall not disclose such Confidential Information and
 * shall use it only in accordance with the terms of the license agreement
 * you entered into with BeyondWeb.
 *
 * Revision History
 * Author              Date             Description
 * ------------------   --------------    ------------------
 *  tkkim               2010. 3. 27.        
 */
package org.springshowcase.mvc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springshowcase.core.commons.config.Configuration;

// TODO: Auto-generated Javadoc
/**
 * The Class TilesController.
 */
@Controller
@RequestMapping("/dummy")
public class MVCController {

	// ---------------------------------------------------------------------
	// Class Variable Declaration
	// ---------------------------------------------------------------------
	/** The Constant logger. */
	private static final Logger logger = LoggerFactory
			.getLogger(MVCController.class);

	@Autowired()
	@Qualifier("configuration")
	private Configuration configuration;

	// ---------------------------------------------------------------------
	// Constructor Method Declaration
	// ---------------------------------------------------------------------
	/**
	 * Instantiates a new config controller.
	 */
	public MVCController() {
	}

	// ---------------------------------------------------------------------
	// DI Method (setter,getter) Declaration
	// ---------------------------------------------------------------------
	// ---------------------------------------------------------------------
	// this Method (public/private) Declaration
	// ---------------------------------------------------------------------
	/**
	 * Gets the config.
	 * 
	 * @return the config
	 */
	@RequestMapping(value = "/index")
	public ModelAndView getMain() {
		logger.info("========= DummyController.getMain");
		return new ModelAndView();
	}

	/**
	 * Handler config.
	 * 
	 * @return the model and view
	 */
	@RequestMapping(value = "/config")
	public ModelAndView getConfig() {
		ModelAndView mav = new ModelAndView();
		mav.addObject("applicationName", this.configuration
				.getString("application.name"));
		mav.addObject("javaRuntimeName", this.configuration
				.getString("java.runtime.name"));
		mav.addObject("javaRuntimeVersion", this.configuration
				.getString("java.runtime.version"));
		logger.info("==TilesController.getConfig");
		return mav;
	}

	// ---------------------------------------------------------------------
	// interface implement Method (public/private) Declaration
	// ----------------------------------.-----------------------------------
	// ---------------------------------------------------------------------
	// abstract implement Method (public/private) Declaration
	// ---------------------------------------------------------------------
	// ---------------------------------------------------------------------
	// abstract Method (public/private) Declaration
	// ---------------------------------------------------------------------

}
